x=-5:0.1:5;
[X,Y]=meshgrid(x);
Z=sin(X);
h=surf(X,Y,Z);
while true
    x=x+0.1;
    [X,Y]=meshgrid(x);
    Z=sin(X);
    set(h,'XData',X,'YData',Y,'ZData',Z);
    drawnow;
end
